﻿using System;
using System.Windows.Controls;

using Gonte.Wpf.Controls.ViewModel;

using MyWpfControlsTest.Model;

namespace MyWpfControlsTest.ViewModel
{
    public class ChildTreeItemViewModel
        : ViewModelTemplate<ChildTreeItem>
    {
        #region Read Only

        //internal readonly BitmapImage IconImage = new BitmapImage(new Uri(@"pack://application:,,/Images/Item.jpg"));

        #endregion

        public ChildTreeItemViewModel(ChildTreeItem item, ViewModelBase parent)
            : base(item, parent, false)
        {
            //IconSource = IconImage;
        }

        public override String Label
        {
            get { return ConcreteModel.Name; }
            set { }
        }

        public override void OnPropertyChanged(String propertyName, Object oldValue)
        {
            if (propertyName.Equals("Name"))
            {
                base.OnPropertyChanged("Label");
            }
        }

        public override ContextMenu CreateContextMenu()
        {
            return new ContextMenu();
        }
    }
}
